import 'antd-mobile/dist/antd-mobile.css'
import {Route,Redirect} from 'react-router-dom'
import Home from "./pages/Home/Home";
import Map from "./pages/Map/Map";
import CityList from "./pages/CityList/CityList";
import HouseDetail from "./pages/HouseDetail/HouseDetail";
import Login from "./pages/Profile/components/Login/Login";
import Regist from './pages/Profile/components/Regist/Regist';
import {AuthRoute} from "./components/AuthRoute";
import MyCollected from "./pages/Profile/components/MyCollected/MyCollected";
import Rent from "./pages/Rent/Rent";
import RentAdd from "./pages/Rent/components/RentAdd/RentAdd";
import RentSearch from "./pages/Rent/components/RentSearch/RentSearch";
import Rented from './pages/Rent/Rented/Rented';

function App() {
    return (
        <div className="App">
            <Redirect to='/home'/>
            <Route component={Home} path='/home' />
            <Route component={CityList} path='/citylist' />
            <Route path='/map'  component={Map}/>
            <Route path='/houseDetail/:id' component={HouseDetail} />


            <Route path='/login' component={Login} />
            <Route path='/regist' exact component={Regist} />
            {/*需要登录才能访问*/}
            <AuthRoute path='/housecollect' component={MyCollected}/>
            <AuthRoute path='/rent' exact component={Rent}/>
            <AuthRoute path='/rent/add/:id' component={RentAdd}/>
            <AuthRoute path='/rent/search' component={RentSearch}/>
            <AuthRoute path='/rent/rented' component={Rented}/>
        </div>
    );
}

export default App;
